<div class="content_info">
<form name="frmSearch" id="frmSearch" action="<?php echo BASE_URL_CLUB.'/subpage/listcomment' ?>" method="POST" enctype="multipart/form-data">
    <table class="list_info">
        <tbody>
            <tr>
                <td style="width: 250px">
                    Theo:&nbsp;<input type="radio" value="1" name="RDC[]" onclick="changeSearch(1);" <?php echo $this->matchid>0?'':'checked';?> />Mới nhất&nbsp;&nbsp;|&nbsp;&nbsp;<input type="radio" value="2" name="RDC[]" onclick="changeSearch(2);" <?php echo $this->matchid>0?'checked':'';?> />Bài viết
                </td>
                <td style="border:none; width: 250px; display:<?php echo $this->matchid>0?'block':'none';?>" id="articleBlock">
                    Match ID:
                    <input type="text" name="id" id="id" value="<?php echo $this->matchid; ?>"> 
                </td>
                <td style="width: 250px">
                    Duyệt:
                    <select id="isapprove" name ="isapprove">
                        <?php foreach ($this->arrApprove as $key => $value): ?>
                            <option value="<?php echo $key ?>" <?php if((string)$key == $this->isapprove) echo 'selected'?>><?php echo $value ?></option>
                        <?php endforeach; ?>
                    </select>
                </td>
                <td style="border:none; width: 300px;">
                     <input type="submit" id="btnSearch" value="Tìm kiếm">
                </td>
        </tbody>
    </table>
    <?php if($this->total > 0)
    {?>

    <?php echo $this->pagingHTML ?>
    <div class="clear"></div>
    <table class="list_info">
        <tbody>
            <tr>
                <th>ID</th>
                <th>Nội dung</th>
                <th>Ngày tạo</th>
                <th>Tùy chọn</th>
            </tr>
             <?php foreach ($this->arrData as $key=>$value): ?>
            <tr>
                <td class="infor" style="width:100px;"><?php echo $value['comment_id'];?></td>
                <td class="infor"><?php echo Fpt_String::subFullString($value['content'],0,300) ?></td>
                <td class="infor" style="width:150px;"><?php echo $this->DateTimeDiff($value['creation_time']); ?></td>
                <td class="infor" style="width:100px; text-align: center">
                <?php if ( $this->matchid>0 && $this->type==2 ) :?>
                    <a href="<?php echo BASE_URL_CLUB.'/subpage/deletecomment/type/2/commentid/'.$value['comment_id'].'/teamid/'.$value['team_id'].'/matchid/'.$this->matchid.$this->url;?>" onclick="return confirm('Are you sure to delete?')">Xóa</a> &nbsp;
                    <a href="<?php echo BASE_URL_CLUB.'/subpage/updatecomment/type/2/commentid/'.$value['comment_id'].'/matchid/'.$this->matchid.$this->url;?>"><?php if($value['is_approve'] == 1)echo 'Đã duyệt'; else echo 'Chờ duyệt'?></a>
                <?php  else :?>
                    <a href="<?php echo BASE_URL_CLUB.'/subpage/deletecomment/type/1/commentid/'.$value['comment_id'].'/teamid/'.$value['team_id'].'/matchid/'.$value['match_id'].$this->url;?>" onclick="return confirm('Are you sure to delete?')">Xóa</a> &nbsp;
                    <a href="<?php echo BASE_URL_CLUB.'/subpage/updatecomment/type/1/commentid/'.$value['comment_id'].'/matchid/'.$value['match_id'].$this->url;?>"><?php if($value['is_approve'] == 1)echo 'Đã duyệt'; else echo 'Chờ duyệt'?></a>
                <?php endif;//end if ?>
                </td>

            </tr>
            <?php endforeach; //End for ?>
            
        </tbody>
    </table>    
    <div class="total_item">
        Có tổng cộng <b><?php echo $this->total;?></b> mẫu tin
    </div>
    <?php echo $this->pagingHTML ?>
    <?php } //End If
    else
    {?>
    <div class="total_item" style="width: 720px;">
        <b>Không tìm thấy mẫu tin nào</b>
    </div>
    <?php
    }
    ?>    
</form>
</div>

<script type="text/javascript">
function changeSearch(id)
{
    if ( id == 2 ) {
        $("#articleBlock").show();
    } else {
        $("#articleBlock").hide();
    }
}
</script>